package com.foo.bussiness.testcases;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import org.junit.Test;
import org.movieexample.ws.GetMovieInfoByNameFault;
import org.movieexample.ws.MovieBusiness;
import org.movieexample.www.movie.GetAllMovieData;
import org.movieexample.www.movie.GetAllMovieDataResponse;
import org.movieexample.www.movie.GetMovieInfoByGenre;
import org.movieexample.www.movie.GetMovieInfoByGenreResponse;
import org.movieexample.www.movie.GetMovieInfoByName;
import org.movieexample.www.movie.GetMovieInfoByNameResponse;
import org.movieexample.www.movie.GetMovieInfoByTheatre;
import org.movieexample.www.movie.GetMovieInfoByTheatreResponse;
import org.movieexample.www.movie.GetMovieInfoByTime;
import org.movieexample.www.movie.GetMovieInfoByTimeResponse;
import org.movieexample.www.movie.GetMovieInfoByType;
import org.movieexample.www.movie.GetMovieInfoByTypeResponse;

public class MovieBussinessTest 
{
	@Test
	public void testGetAllMovieData() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetAllMovieData getAllMovieData = new GetAllMovieData();
		getAllMovieData.setIn("");
		try 
		{
			GetAllMovieDataResponse allData =  bussiness.getAllMovieData(getAllMovieData);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
	
	@Test
	public void testGetMovieByName() throws GetMovieInfoByNameFault 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieInfoByName getMovieInfoByName = new GetMovieInfoByName();
		getMovieInfoByName.setIn("Love");
		try 
		{
			System.out.println(" " + getMovieInfoByName.getIn());
			GetMovieInfoByNameResponse getbyname = bussiness.getMovieInfoByName(getMovieInfoByName);
			assertNotNull(getbyname);
		} 
		catch (Exception e) 
		{
			fail("Get Movie Data By Name testcase failed");
		}
	}
	@Test
	public void testGetMovieByGenre() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieInfoByGenre getMovieByGenre = new GetMovieInfoByGenre();
		getMovieByGenre.setIn("Comedy");
		try 
		{
			GetMovieInfoByGenreResponse allData =  bussiness.getMovieInfoByGenre(getMovieByGenre);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
	@Test
	public void testGetMovieByTime() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieInfoByTime getMovieInfoByTime = new GetMovieInfoByTime();
		getMovieInfoByTime.setIn("2:30pm");
		try 
		{
			GetMovieInfoByTimeResponse allData =  bussiness.getMovieInfoByTime(getMovieInfoByTime);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
	
	@Test
	public void testGetMovieByTheatre() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieInfoByTheatre getMovieInfoBytheatre = new GetMovieInfoByTheatre();
		getMovieInfoBytheatre.setIn("");
		try 
		{
			GetMovieInfoByTheatreResponse allData =  bussiness.getMovieInfoByTheatre(getMovieInfoBytheatre);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
	@Test
	public void testGetMovieByType() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieInfoByType getMovieInfoBytype = new GetMovieInfoByType();
		getMovieInfoBytype.setIn("");
		try 
		{
			GetMovieInfoByTypeResponse allData =  bussiness.getMovieInfoByType(getMovieInfoBytype);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
}
